package com.poobo.util.pager;

import java.util.List;

public class Page {

	private int pageNum = 1;// 总页数
	private int pageNo = 1;// 当前页
	private int pageSize = 15;// 一页放的数据条数
	private int rowCount = 0;// 总记录数
	private String baseHql; // 查询结果集的hql
	private String countHql; // 查询总记录数的hql
	private String baseSql; // 查询结果集的sql
	private String countSql; // 查询总记录数的sql
	private List<Object> param; // sql、hql 参数
	private List<?> pageList; // 结果集 object = T 或者 object[]

	public Page() {

	}

	public Page(int pageSize) {
		this.pageSize = pageSize;
	}

	public Page(int pageSize, int pageNo) {
		this.pageSize = pageSize;
		this.pageNo = pageNo;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getRowCount() {
		return rowCount;
	}

	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
		pageNum = rowCount % pageSize == 0 ? rowCount / pageSize : rowCount
				/ pageSize + 1;

	}

	public String getBaseHql() {
		return baseHql;
	}

	public void setBaseHql(String baseHql) {
		this.baseHql = baseHql;
	}

	public String getCountHql() {
		return countHql;
	}

	public void setCountHql(String countHql) {
		this.countHql = countHql;
	}

	public String getBaseSql() {
		return baseSql;
	}

	public void setBaseSql(String baseSql) {
		this.baseSql = baseSql;
	}

	public String getCountSql() {
		return countSql;
	}

	public void setCountSql(String countSql) {
		this.countSql = countSql;
	}

	public List<Object> getParam() {
		return param;
	}

	public void setParam(List<Object> param) {
		this.param = param;
	}

	public List<?> getPageList() {
		return pageList;
	}

	public void setPageList(List<?> pageList) {
		this.pageList = pageList;
	}

}
